@extends('layouts.admin')
@push('morecss')
@endpush

@push('morescript')
    <script type="application/javascript">
        let page_params = {
            @can('admin.wxqrcodegroup.index')
            url_list: '{{ route('admin.wxqrcodegroup.index') }}',
            @endcan
            @can('admin.wxqrcodegroup.create')
            url_add: '{{ route('admin.wxqrcodegroup.create') }}',
            @endcan
            @can('admin.wxqrcodegroup.update')
            url_edit: '{{ route('admin.wxqrcodegroup.update') }}',
            @endcan
            @can('admin.wxqrcodegroup.destroy')
            url_del: '{{ route('admin.wxqrcodegroup.destroy') }}',
            @endcan
        }
    </script>
    <!-- require page js -->
    <script src="{{ mix('js/admin/wxqrcodegroup_index.js') }}"></script>
@endpush
@section('content')
    <div class="wrapper wrapper-content animated fadeInRight ecommerce">
        <div class="ibox-content m-b-sm border-bottom">
            <div class="row">
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="control-label" for="product_name">关键字</label>
                        <input type="text" id="keyword" name="keyword" value="" placeholder="请输入搜索关键字"
                               class="form-control">
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="form-group">
                        <label class="control-label" for="product_name">&nbsp;&nbsp;</label>
                        <div>
                            <button class="btn btn-primary" type="button" id="btn-search"><i class="fa fa-search"></i>
                                搜索
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="toolbar" class="col-sm-2">
            @can('admin.wxqrcodegroup.create')
            <button class="btn btn-primary" id="btn-add"><i class="fa fa-plus"></i> 添加分组</button>
            @endcan
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox">
                    <div class="ibox-content">
                        <table id="table" data-classes="table table-no-bordered">
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="box-form" style="display: none;">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form method="POST" class="form-horizontal">
                        <input type="hidden" name="group_id" id="group_id" value="">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">分组标识</label>
                            <div class="col-sm-10">
                                <select class="form-control" name="group_key" id="group_key" v-model="curLevelData.card_base_id">
                                    @foreach ($groupKeyList as $key => $val)
                                        <option value="{{ $key }}">{{ $val }}</option>
                                    @endforeach
                                </select>
                                <span class="help-block m-b-none">选择不同的分组标识会使用不同的扫码处理逻辑</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">分组名</label>
                            <div class="col-sm-10">
                                <input type="text" name="group_name" id="group_name" value="" class="form-control">
                                <span class="help-block m-b-none">
                                </span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">描述</label>
                            <div class="col-sm-10">
                                <textarea name="description" id="description" class="form-control"></textarea>
                                <span class="help-block m-b-none">
                                </span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">二维码类别</label>
                            <div class="col-sm-10">
                                <div class="col-sm-4">
                                    <label for="is_forever_1">
                                        <input type="radio" name="is_forever" id="is_forever_1" value="1">
                                        永久二维码
                                    </label>
                                </div>
                                <div class="col-sm-4">
                                    <label for="is_forever_2">
                                        <input type="radio" name="is_forever" id="is_forever_2" value="0">
                                        临时二维码
                                    </label>
                                </div>
                                <span class="help-block m-b-none col-sm-12">设置该分类下的二维码类型，临时二维码：是有过期时间的，主要用于帐号绑定等不要求二维码永久保存的业务场景；永久二维码，是无过期时间的，但数量较少（目前为最多10万个），永久二维码主要用于适用于帐号绑定、用户来源统计等场景。</span>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-4">
                                <button class="btn btn-primary" type="button" id="btn-sub">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection